package com.ruoyi.project.mall.service.impl;


import com.ruoyi.common.utils.bootdo.R;
import com.ruoyi.project.mall.dao.MallNewsClassDao;
import com.ruoyi.project.mall.domain.MallNewsClassDO;
import com.ruoyi.project.mall.service.MallNewsClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class MallNewsClassServiceImpl implements MallNewsClassService {
	@Autowired
	private MallNewsClassDao mallNewsClassDao;
	
	@Override
	public MallNewsClassDO get(String id){
		return mallNewsClassDao.get(id);
	}
	
	@Override
	public List<MallNewsClassDO> list(Map<String, Object> map){
		return mallNewsClassDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return mallNewsClassDao.count(map);
	}
	
	@Override
	public int save(MallNewsClassDO mallNewsClass){
		return mallNewsClassDao.save(mallNewsClass);
	}
	
	@Override
	public int update(MallNewsClassDO mallNewsClass){
		return mallNewsClassDao.update(mallNewsClass);
	}
	
	@Override
	public int remove(String id){
		return mallNewsClassDao.remove(id);
	}
	
	@Override
	public int batchRemove(String[] ids){
		return mallNewsClassDao.batchRemove(ids);
	}

    @Override
    public List<MallNewsClassDO> likeList(Map<String, Object> map){
        return mallNewsClassDao.likeList(map);
    }
    @Override
    public int likeListCount(Map<String, Object> map){
        return mallNewsClassDao.likeListCount(map);
    }

	@Override
	public List<Map<String, Object>> queryAllForIdAndName(Map<String, Object> map) {

		return mallNewsClassDao.queryAllForIdAndName(map);
	}

    @Override
    public R getNewsClass() {
		Map<String,Object> map = new HashMap<>();
		map.put("delFlag","0");
		List<Map<String, Object>> maps = mallNewsClassDao.queryAllForIdAndName(map);
		return R.ok().put("data",maps);

	}

}
